package com.cy.pj.sys.service.aspect;

import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class SysTimeAspect {
    @Pointcut("@annotation(com.cy.pj.common.annotation.RequiredTime)")
    public void doTime(){}

    @Before("doTime()")
    public void doBefore(){
        System.out.println("@Before");
    }

    @After("doTime()")
    public void doAfter(){
        System.out.println("@After");
    }

    @AfterReturning("doTime()")
    public void doAfterReturning(){
        System.out.println("@AfterThrowing");
    }

    @AfterThrowing("doTime()")
    public void doAfterThrowing(){
        System.out.println("@AfterThrowing");
    }
}
